package uoit.csci2020u.tutorial3;

import java.io.IOException;

import java.util.ArrayList;
import java.util.List;

public class TestFileIO {
	public static void main(String[] args) {
		int count = Integer.parseInt(args[0]);
		String filename = args[1];
		
		MakeNumber mknums = new MakeNumber();
		List<Float> numbers = mknums.makeRandomNumbers(count, 10f);
		
		try {
			mknums.save(numbers, filename);
		} catch (IOException ex) {
			ex.printStackTrace();
		}
		
		List<Float> readInNumbers = new ArrayList<Float>();
		
		try {
			readInNumbers = mknums.load(filename);
		} catch (IOException ex) {
			ex.printStackTrace();
		}
		
		for (int i = 0; i < count; i++) {
			System.out.println(numbers.get(i));
			System.out.println(readInNumbers.get(i));
		}
		
		System.out.println("Success.");
	}
}
